Question: The graph of the rational function $\frac{p(x)}{q(x)}$ is shown below, with a horizontal asymptote of $y = 0$ and a vertical asymptote of $ x=-1 $. If $q(x)$ is quadratic, $p(2)=1$, and $q(2) = 3$, find $p(x) + q(x).$
[asy]
size(8cm);
import graph;

Label f; 
f.p=fontsize(6); 

real f(real x) {return (x-1)/((x-1)*(x+1));}

int gridsize = 5;
draw((-gridsize,0)--(gridsize,0), black+1bp, Arrows(8));
draw((0,-gridsize)--(0, gridsize), black+1bp, Arrows(8));
label("$x$", (gridsize, 0), E);
label("$y$", (0, gridsize), N);
label("$0$", (0,0),SE, p=fontsize(8pt));
for (int i=-gridsize+1; i<0; ++i){
    label("$"+string(i)+"$",(i,0),S, p=fontsize(8pt));
    label("$"+string(i)+"$",(0,i),E, p=fontsize(8pt));}
for (int i=1; i<=gridsize-1; ++i){
    label("$"+string(i)+"$",(i,0),S, p=fontsize(8pt));
    label("$"+string(i)+"$",(0,i),E, p=fontsize(8pt));}



draw(graph(f,-5,-1.2));
draw(graph(f,-.8,0.85));
draw(graph(f,1.15,5));
draw((-1,-5)--(-1,5), dashed);
draw(circle((1,.5),.15));



[/asy]
Solution: Since $q(x)$ is a quadratic, and we have a horizontal asymptote at $y=0,$ we know that $p(x)$ must be linear.

Since we have a hole at $x=1,$ there must be a factor of $x-1$ in both $p(x)$ and $q(x).$ Additionally, since there is a vertical asymptote at $x=-1,$ the denominator $q(x)$ must have a factor of $x+1.$ Then, $p(x) = a(x-1)$ and $q(x) = b(x+1)(x-1),$ for some constants $a$ and $b.$

Since $p(2) = 1$, we have $a(2-1) = 1$ and hence $a=1$. Since $q(2) = 3$, we have $b(2+1)(2-1) = 3$ and hence $b=1$.

So $p(x) = x - 1$ and $q(x) = (x + 1)(x - 1) = x^2 - 1,$ so $p(x) + q(x) = \boxed{x^2 + x - 2}.$